<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="renderer" content="webkit" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=0,uc-fitscreen=yes" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta name="format-detection" content="telephone=no" />
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
		<link rel="icon" href="https://jscdn.com.cn/highcharts/images/favicon.ico">
		<title>考试考勤</title>
		<meta name="keywords" content="考试考勤" />
		<meta name="description" content="考试考勤" />
		<!-- miniMObile.css、js -->
		<link rel="stylesheet" type="text/css" href="css/miniMobile.css" />
		<script type="text/javascript" src="js/zepto.min.js"></script>
		<script type="text/javascript" src="js/miniMobile.js"></script>
		<script type="text/javascript" src="js/api.js"></script>
		<!-- fonticon -->
		<link rel="stylesheet" type="text/css" href="plugins/fonticon/iconfont.css" />
		<!-- animate.css -->
		<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.css" />
		<!-- swiper -->
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.5/css/swiper.min.css">
		<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.5/js/swiper.min.js"></script>
	

	</head>

	<body class="fadeIn animated">
		<div id="message" v-cloak>
			<div class="grid clearfix">
				<div class="grid  clearfix stu-info-title" style="background: #f7faff;line-height: 1rem;padding-left: 0.3rem;padding-right: 0.3rem;" >
					<div class="box col-12 h10 f30">未考试:<span class="f30" style="color: red;">{{notjoin.count}}</span>人</div>
				</div>
				
				<section class="demo-nav t-c f28 clearfix" style="background: #FFFFFF;width: 100%;padding-bottom: 0.5rem;" v-cloak>
					<div class="col-3 t-c h5" v-for="item in notjoin.list">
						<div style="color: #535353;line-height: 1rem;">{{item.username}}</div>
					</div>
				</section>
			
			</div>
			<div class="grid clearfix">
				<div class="grid  clearfix stu-info-title" style="background: #f7faff;line-height: 1rem;padding-left: 0.3rem;padding-right: 0.3rem;" >
					<div class="box col-12 h10 f30">未交卷:<span class="f30" style="color: red;">{{notsub.count}}</span>人</div>
				</div>
				
				<section class="demo-nav t-c f28 clearfix" style="background: #FFFFFF;width: 100%;padding-bottom: 0.5rem;" v-cloak>
					<div class="col-3 t-c h5" style="line-height: 1rem;" v-for="item in notsub.list">
						<span style="background: #FFFFFF;color: #535353;">{{item.username}}</span>
					</div>
				</section>
			
			</div>
		</div>

	</body>


	<!-- 开发环境版本，包含了有帮助的命令行警告 -->
	<script src="https://cdn.staticfile.org/vue/2.2.2/vue.js"></script>
	<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.js"></script>
	<!-- 百度 CDN: -->
	<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
	<script type="text/javascript">
		new Vue({
			el: '#message',
			data: {
				params: getQueryString("params"),
				complete: [],
				notsub: [],
				notjoin: [],

			},
			mounted: function() {
				this.isterminal();
				if (browser.versions.weixin) {
					document.getElementById('JweixinTip').style.display = 'block';
				}
				//考试报告试卷分析-考试考勤接口
				this.scoreAttendance();

			},
			methods: {
				//判断 android ios
				isterminal: function() {
					var that = this;
					if (that.isTerminal == 'android') {
						that.isTerminal = 1;
					} else if (that.isTerminal == 'ios') {
						that.isTerminal = 2;
					}
				},
				scoreAttendance: function() {
					var b = new Base64();
					var str = b.decode(this.params);
					var objParams = JSON.parse(str);
					console.log(objParams);
					this.terminal = objParams.terminal;
					//考试报告试卷分析-成绩分布
					this.$http.post(scoreAttendanceApi, objParams, {
						emulateJSON: true
					}).then(function(res) {
						if (res.data.error_code == 200) {
							console.log(res.data.data)
							this.complete = res.data.data.complete;
							this.notsub = res.data.data.notsub;
							this.notjoin = res.data.data.notjoin;
							
						} else {
							//请求错误
							window.android.errorMsg(res.data.info);
						}
					}).catch(e => {
						// 打印一下错误
						console.log(e);
					})
				},
				click_x5: function() {
					if (browser.versions.android) {
						console.log('-------------------打印成功，走了调用安卓分享---------------------');
						AndroidBack.onX5ButtonClicked();
					}
				}

			},
			filters: {
				numFilter(value) {
					// 截取当前数据到小数点后三位
					let transformVal = parseFloat(value).toFixed(3)
					let realVal = transformVal.substring(0, transformVal.length - 1)
					if (realVal == 'NaN') {
						realVal = 0;
					}
					// num.toFixed(3)获取的是字符串
					return parseFloat(realVal)
				},
				numLawFilter([num, count]) {
					let law = num / count * 100;
					// 截取当前数据到小数点后三位
					let transformVal = parseFloat(law).toFixed(0);

					if (transformVal == 'NaN') {
						transformVal = 0;
					}

					// console.log(transformVal);

					//     let realVal = transformVal.substring(0, transformVal.length - 1)
					// num.toFixed(3)获取的是字符串
					return parseFloat(transformVal)
				},
				formatUnixtimestamp(value) {
					return formatUnixtimestamp(value);
				}

			}
		});

	
	</script>

</html>
